<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="_self">
    <title>新增进货记录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="新增,进货,记录">
	<meta http-equiv="description" content="This is my page">

	<style type="text/css">
	</style>

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'货存管理'},{'name':'进货记录'},{'name':'新增记录'}]"/>
    			<jsp:param name="width" value="70%"/>
    		</jsp:include>
    		
    		<s:hidden name="kindergartenId" id="kindergartenId"></s:hidden>
    		
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr bgcolor="#FFFFFF">
    				<td width="20%" align="right" class="label">
    					货物：
    				</td>
    				<td width="30%" align="left">
    					<s:select name="ir.stockObj.id" id="objId" list="objList" listKey="id" listValue="objName" cssStyle="width:140px"></s:select>
    				</td>
    				<td width="20%" align="right" class="label">
    					进货时间：
    				</td>
    				<td width="30%" align="left">
    					<s:textfield name="ir.importTime" id="importTime" cssStyle="width:120px" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" cssClass="WDate search"></s:textfield>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					进货数量：
    				</td>
    				<td align="left">
    					<s:textfield name="ir.importCount" id="importCount" cssStyle="width:140px" maxlength="10"></s:textfield>
    				</td>
    				<td align="right">
    					
    				</td>
    				<td align="left">
    					
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					备注：
    				</td>
    				<td align="left" colspan="3">
    					<s:textarea name="ir.remark" id="remark" cssStyle="width:95%; height:100px;"></s:textarea>
    				</td>
    			</tr>
    		</table>
    		
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="新增" class="btn" onclick="addImportRecord()" />
    				</td>
    			</tr>
    		</table>
    		
    		
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function addImportRecord()
    {
    	var importTime = $('#importTime');
    	var importCount = $('#importCount');
    	var remark = $('#remark');
    	if(!isNotNull(importTime.val()))
    	{
    		showMsg('进货时间不能为空。', function(){importTime.focus();});
    		return;
    	}
    	if(!isNotNull(importCount.val()))
    	{
    		showMsg('进货数量不能为空。', function(){importCount.focus();});
    		return;
    	}
    	if(checkFloat(importCount) == false)
    	{
    		showMsg('进货数量有误。', function(){importCount.focus();});
    		return;
    	}
    	if(remark.val().length > 200)
    	{
    		showMsg('备注不能超过200字。', function(){remark.focus();});
    		return;
    	}
    	
    	var url = 'inner/stock/addImportRecord.action';
    	ajaxAction(url, 'post', 'frm', false, function(){
    		window.opener.searchThis();
    		window.close();
    	});
    }
    </script>
  </body>
</html>
